﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace Entities
{
    [MetadataType(typeof(StudyPlanItemMetadata))]
    public class StudyPlanItem : BaseEntity<int>
    {
        public StudyPlanItem()
        {
            Allocations = new List<Allocation>();
            this.Department = new Department();
            this.Discipline = new Discipline();
            this.Direction = new Direction();
        }
        public virtual Department Department { get; set; }
        public virtual Discipline Discipline { get; set; }
        public virtual Direction Direction { get; set; }
        public virtual int Semestr { get; set; }
        public virtual int HoursLecture { get; set; }
        public virtual int HoursLaboratory { get; set; }
        public virtual int HoursPractice { get; set; }
        public virtual int HoursSRS { get; set; }
        public virtual String TypeSRS { get; set; }
        public virtual String ControlType { get; set; }

        public virtual IList<Allocation> Allocations { get; set; }
    }
    
    public class StudyPlanItemMetadata
    {
        [Required]
        [DisplayName("Кафедра")]
        public virtual Department Department { get; set; }
        [Required]
        [DisplayName("Дисциплина")]
        public virtual Discipline Discipline { get; set; }
        [Required]
        [DisplayName("Направление")]
        public virtual Direction Direction { get; set; }
        [Required]
        [DisplayName("Семестр")]
        public virtual int Semestr { get; set; }
        [Required]
        [DisplayName("Лекции, часов за семестр")]
        public virtual int HoursLecture { get; set; }
        [Required]
        [DisplayName("Лабораторные, часов за семестр")]
        public virtual int HoursLaboratory { get; set; }
        [Required]
        [DisplayName("Практики, часов за семестр")]
        public virtual int HoursPractice { get; set; }
        [Required]
        [DisplayName("СРС, часов за семестр")]
        public virtual int HoursSRS { get; set; }
        [Required]
        [DisplayName("Тип СРС")]
        public virtual String TypeSRS { get; set; }
        [Required]
        [DisplayName("Тип контроля")]
        public virtual String ControlType { get; set; }
    }
}